#ifndef _USART_H_
#define _USART_H_

#include "stdint.h"

/* UART_Mode UART Transfer Mode */
#define UART_MODE_RX           1
#define UART_MODE_TX           2
#define UART_MODE_TX_RX        3

/* UART_Hardware_Flow_Control UART Hardware Flow Control */
#define UART_HWCONTROL_NONE    0
#define UART_HWCONTROL_RTS     1
#define UART_HWCONTROL_CTS     2
#define UART_HWCONTROL_RTS_CTS 3

/* gd32 uart/usart init struct */
typedef struct
{
    uint32_t periph;
    uint32_t BaudRate;
    uint32_t WordLength;
    uint32_t StopBits;
    uint32_t Parity;
    uint32_t Mode;
    uint32_t HwFlowCtl;
    
}uart_parameter_struct;

int uart_init(uart_parameter_struct * uartx);

#endif
